<template>
        <el-descriptions title="我的详细资料" :column="1" :size="size" border>
            <el-descriptions-item label="用户名">{{ user.username }}</el-descriptions-item>
            <el-descriptions-item label="真实姓名">{{ user.realname }}</el-descriptions-item>
            <el-descriptions-item label="电话">{{ user.phone }}</el-descriptions-item>
            <el-descriptions-item label="最近登录时间">{{ user.gmtLastLogin }}</el-descriptions-item>
            <el-descriptions-item label="角色">{{ user.roles[0] }}</el-descriptions-item>
            <el-descriptions-item label="状态">
                <el-button type="primary" size="small"> {{ user.status == 1 ? '正常' : '异常' }}</el-button>
            </el-descriptions-item>
        </el-descriptions>
</template>

<script lang="ts" setup>
import { useUsertore } from '@/stores/user'
import { ref } from 'vue'
const size = ref('8')
const store = useUsertore()//使用useUsertore这个状态方法
const user = store.user//赋值
</script>
